package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.mapper.AlertDataMapper;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AlertDataServiceImpl implements AlertDataService {

    @Autowired
    AlertDataMapper alertDataMapper;
    @Override
    public PageResponse<AlertDataVo> page(Integer pageNum, Integer pageSize, String deviceName, Integer endTime, Integer id, Integer startTime, Integer status) {

        PageHelper.startPage(pageNum,pageSize);
        Page<AlertDataVo> page =alertDataMapper.page(deviceName,endTime,id,startTime,status);
        return PageResponse.of(page,AlertDataVo.class);
    }
}
